<script language="javascript1.4" type="text/javascript">
	/*
		Reset by parent and name
	*/
	var sRatingResetConfirm=new Array();
	sRatingResetConfirm[1]	='{t t='Ar tikrai norite išvalyti šią reikšmę'}';
	sRatingResetConfirm[2]	='{t t='Ar tikrai norite išvalyti visas šio reitingo reikšmes'}';	
	sRatingResetConfirm[3]	='{t t='Ar tikrai norite išvalyti *visus* reitingus?'}';
	
	{literal}
	function rating_reset_pn(nMode, sFormName, nParent, sName){		
		if (nMode==1) 		sMode='reset_by_parent_and_name';
		else if (nMode==2) 	sMode='reset_by_parent';
		else if (nMode==3)	sMode='reset';		
		
		if(!confirm(sRatingResetConfirm[nMode])) return false;
		
		document.forms[sFormName].act.value=sMode;		
		
		if (nParent!=-1) 	document.forms[sFormName].parent.value=nParent;
		if (sName.length>0) document.forms[sFormName].name.value=sName;
		document.forms[sFormName].submit();
	}
	{/literal}
</script>

<form name="reset_individual_rating" enctype="multipart/form-data" method="post">
	<input name="admin" type="hidden" value="1">
	<input name="module" type="hidden" value="reiting">
	<input name="referer" type="hidden" value="{ext->get_referer}">
	
	<input name="act" type="hidden" value="">	
	<input name="parent" type="hidden" value="">
	<input name="name" type="hidden" value="">
</form>

<div style="background-color:#DBE1E5; padding:0px 7px 0 7px; border-left:1px solid #C4CDD2; border-right:1px solid #C4CDD2; border-bottom:1px solid #C4CDD2; width:auto; margin:auto" class="this">
	<div style="width:100%; padding:7px 0px 7px 0px;">
	{include file="admin/modules/reiting/menu.htm"}	
	{ext->class_function class="reiting" func="get_reitings" assign="list"}
	{ext->countArray array=$list assign="count"}
	{if $count > 0}
		{foreach from=$list key="page_id" item="item"}
			{if $page_id == 0}
				<div class="ParentRow">{t t='admin_menu_title_page'}</div>				
			{else}
				{ext->get_page_info id=$page_id assign="page_data"}
				<div class="ParentRow" onClick="rating_toggle('p{$page_id}')"><b>{$page_data.name}</b> ({t t=$page_data.type})</div>
			{/if}
			{foreach from=$item.elements key="el_key" item="el"}			
				<div class="ReitingRow"><img class="btnImg" style="vertical-align:middle; margin:0 10px 0 12px" src="_tvs_system_core_/design/img/admin/_icon_delete.gif" onClick="rating_reset_pn(2, 'reset_individual_rating',{$el_key},'');"><b>{$el.name}</b> ({t t=$el.type})</div>				
				<table cellpadding="0" cellspacing="0" class="MainTable">
					{foreach from=$el.elements key="reit_key" item="reit"}		
					<tr>
						<td class="td1">&nbsp;</td>
						<td class="td2">{$reit_key|strip_tags|truncate:40:'...':true|default:"..."}</td>	
						<td class="td3">{$reit.count}</td>	
						<td class="td4">{$reit.mid}</td>
						<td class="td5">{$reit.suma}</td>	
						<td class="td6"><img class="btnImg" src="_tvs_system_core_/design/img/admin/_icon_delete.gif" onClick="rating_reset_pn(1, 'reset_individual_rating',{$el_key},'{$reit_key|addslashes}');"></td>			
					</tr>							
					{/foreach}
				</table>
			{/foreach}
		{/foreach}
	{else}		
		<div style="line-height:50px; background-color:#FFFFFF; text-align:center; margin:12px 0 12px 0; border-bottom:1px solid #25404E;  border-top:1px solid #25404E;">{t t='Nėra nei vieno reitingo'}.</div>
	{/if}	
	{include file="admin/modules/reiting/menu.htm"}		
	</div>	
</div>